<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏v2</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game-container">
        <h1>贪吃蛇游戏v2</h1>
        <div class="game-instructions">
            <p>使用方向键控制蛇的移动</p>
            <p>吃到食物增加分数</p>
            <p>撞到墙壁或自身游戏结束</p>
        </div>
        <canvas id="gameCanvas" width="400" height="400"></canvas>
        <div class="controls">
            <div class="speed-control">
                <label for="speedSlider">速度:</label>
                <input type="range" id="speedSlider" min="1" max="10" value="5">
                <span id="speedValue">5</span>
            </div>
            <div class="score">分数: <span id="score">0</span></div>
            <div class="game-buttons">
                <button id="startBtn">开始游戏</button>
                <button id="pauseBtn">暂停</button>
                <button id="restartBtn">重新开始</button>
            </div>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>